package com.liumingtai.demo03.upload.service;

import cn.hutool.core.util.StrUtil;
import com.alibaba.dubbo.config.annotation.Service;
import com.liumingtai.demo03.upload.utils.OSSUtil;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.io.InputStream;

@Service
@Component
@Log4j2
public class UploadServiceImpl implements com.liumingtai.demo03.api.UploadService {

    @Autowired
    OSSUtil oSSUtil;

    @Override
    public String uploadImage(String fileName, InputStream is) {
        log.info(StrUtil.format("InputStream is ===> {}", is));
        return oSSUtil.upload(fileName, is);
    }
}
